package com.weilus;

import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.messaging.Message;
import org.springframework.stereotype.Service;


@Service
@Slf4j
@EnableBinding({StreamChannel.class})
public class StreamConsumer {

    @StreamListener(StreamChannel.INPUT)
    public void receive(Message message) {
        log.info("通过stream收到消息，tags={} payload = {}",message.getHeaders().get("TAGS"),message.getPayload());
    }

}
